<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/workbusiness/EQU_EQUIPMENT_TOOL.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/workbusiness/EQU_EQUIPMENT_TOOL.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '当前加工中设备',
                name: 'workbusiness/EQU_EQUIPMENT_TOOL',
                url: "/EQU_EQUIPMENT_TOOL/",
                sortName: "CreateOn"
            });
            const editFormFields = ref({"EquipmentId":""});
            const editFormOptions = ref([[{"dataKey":"设备","data":[],"title":"设备","field":"EquipmentId","type":"select"}]]);
            const searchFormFields = ref({"ProCode":"","EquipmentId":""});
            const searchFormOptions = ref([[{"dataKey":"工单（没有Id）","data":[],"title":"工单","field":"ProCode","type":"select"},{"dataKey":"设备","data":[],"title":"设备","field":"EquipmentId","type":"select"}]]);
            const columns = ref([{field:'Id',title:'id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ProCode',title:'工单',type:'string',bind:{ key:'工单（没有Id）',data:[]},sort:true,width:120,align:'left',sort:true},
                       {field:'EquipmentId',title:'设备',type:'string',bind:{ key:'设备',data:[]},width:110,align:'left'},
                       {field:'TOOL_Id',title:'刀具',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateBy',title:'创建人',type:'string',width:110,align:'left'},
                       {field:'CreateOn',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'UpdateBy',title:'更新人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'LastUpdateOn',title:'更新时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'IsDeleted',title:'逻辑删除 0/不删除 1/已删除',type:'bool',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "程序",
                table: "PROC_PROGRAM",
                columns: [{field:'Id',title:'Id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Identifier',title:'工单',type:'string',bind:{ key:'工单（没有Id）',data:[]},width:180,edit:{type:'text'},align:'left',sort:true},
                       {field:'ftpmachiningcenter_id',title:'FTP加工中心单外键',type:'int',width:110,hidden:true,align:'left'},
                       {field:'sequence',title:'序',type:'int',sort:true,width:80,edit:{type:'number'},align:'left'},
                       {field:'program_name',title:'程序名称',type:'string',width:110,edit:{type:'text'},align:'left'},
                       {field:'tool_name',title:'刀具名称',type:'string',width:110,hidden:true,edit:{type:'text'},align:'left'},
                       {field:'tool_handle',title:'刀柄',type:'string',width:110,edit:{type:''},align:'left'},
                       {field:'tool_collet',title:'夹头',type:'string',width:110,edit:{type:''},align:'left'},
                       {field:'knife_length',title:'刀具长度',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'blade_length',title:'刃长',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'category',title:'类型',type:'string',width:110,edit:{type:'text'},align:'left'},
                       {field:'accuracy',title:'刀损值',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'rotate_speed',title:'转速',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'feed',title:'进给',type:'string',width:100,edit:{type:'decimal'},align:'left'},
                       {field:'side_bottom_margin',title:'侧/底余量',type:'string',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'z_depth',title:'Z深',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'RfidCode',title:'RfidCode',type:'string',width:120,hidden:true,align:'left'},
                       {field:'tool_materials',title:'刀具材料',type:'string',width:110,align:'left'},
                       {field:'vendor_code',title:'厂商代码',type:'string',width:110,align:'left'},
                       {field:'time',title:'时长',type:'string',width:220,align:'left'},
                       {field:'CreateBy',title:'创建人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateOn',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'UpdateBy',title:'更新人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'LastUpdateOn',title:'更新时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'IsDeleted',title:'逻辑删除  0/不删除  1/已删除',type:'bool',width:110,hidden:true,align:'left'},
                       {field:'remark',title:'选择工单',type:'string',bind:{ key:'程序（没Id）',data:[]},width:220,edit:{type:'select'},align:'left'},
                       {field:'ProCode',title:'程序编码',type:'string',width:120,hidden:true,align:'left'},
                       {field:'ParentId',title:'父级',type:'string',bind:{ key:'程序级联',data:[]},width:120,edit:{type:'select'},align:'left'},
                       {field:'DisuseState',title:'弃用状态 ',type:'string',width:110,align:'left'},
                       {field:'UseState',title:'使用状态',type:'string',bind:{ key:'程序使用状态',data:[]},width:110,align:'left'},
                       {field:'SecornSeq',title:'第二序',type:'int',width:80,align:'left'},
                       {field:'Lock',title:'锁定',type:'string',bind:{ key:'enable',data:[]},width:110,edit:{type:'radio'},align:'left'}],
                sortName: "CreateOn",
                key: "Id"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
